﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Game.cs" company="">
//   
// </copyright>
//  <summary>
//   The game.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Shatranj
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The game.
    /// </summary>
    public class Game : IGame
    {
        #region Public Properties

        /// <summary>
        /// Gets the blitz.
        /// </summary>
        public static Game Blitz
        {
            get
            {
                return new Game
                           {
                               IsTimed = true, 
                               TimeInMinutes = 5, 
                               Players =
                                   new[]
                                       {
                                           new Player
                                               {
                                                   Force = Army.White, 
                                                   Moves = new Stack<Move>(), 
                                                   Name = "Player1"
                                               }, 
                                           new Player
                                               {
                                                   Force = Army.Black, 
                                                   Moves = new Stack<Move>(), 
                                                   Name = "Player2"
                                               }
                                       }, 
                               Board = new Chessboard(), 
                               Id = DateTime.Now.Ticks, 
                               CurrentTurn = Turn.White
                           };
            }
        }

        /// <summary>
        /// Gets or sets the board.
        /// </summary>
        public IChessboard Board { get; set; }

        /// <summary>
        /// Gets or sets the current turn.
        /// </summary>
        public Turn CurrentTurn { get; set; }

        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether is timed.
        /// </summary>
        public bool IsTimed { get; set; }

        /// <summary>
        /// Gets or sets the players.
        /// </summary>
        public Player[] Players { get; set; }

        /// <summary>
        /// Gets or sets the time in minutes.
        /// </summary>
        public int TimeInMinutes { get; set; }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// The load.
        /// </summary>
        /// <returns>
        /// The <see cref="Game"/>.
        /// </returns>
        public static Game Load()
        {
            return null;
        }

        /// <summary>
        /// The save.
        /// </summary>
        public void Save()
        {
        }

        #endregion
    }
}